<template>
  <!-- 排行榜列表 -->
  <div class="Podcast">
    <ul>
      <li
        v-for="(item,index) in Podcast"
        :key="index"
        @click="goTo('podcast/toplist',item.id)"
      >
        <div class="media-img">
          <van-card :thumb="item.picUrl">
          </van-card>

        </div>
        <div class="media-text">
          <p
            v-for="(song,index) in item.songList"
            :key="index"
          >
            <span>{{index+1}}.</span>
            <span class="songname">{{song.songname}}</span>
            <span>---{{song.singername}}</span>
          </p>
        </div>
        <div class="arrow"></div>
      </li>
    </ul>
    <router-view></router-view>
  </div>
</template>
<script>
import getPodcastData from '@/api/modules/tk_Api.js'

export default {
  components: {

  },
  data() {
    return {
      Podcast: []
    }
  },
  created() {
    this._getPodcastData()
  },
  methods: {
    _getPodcastData() {
      getPodcastData().then((res) => {
        this.Podcast = res.data.topList
      })
    },
    goTo(place, id) {
      let url = `/${place}/${id}`
      this.$router.push(url)
    }
  }
}

</script>
<style scoped>
.loading-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.Podcast {
  width: 100%;
  /* padding: 0 20px; */
  background-color: #f4f4f4;
  overflow: hidden;
  margin-top: 44px;
  margin-bottom: 50px;
}
.Podcast li {
  position: relative;
  display: flex;
  align-items: center;
  height: 112px;
  width: 100%;
  margin-top: 20px;
  background-color: #fff;
}
.Podcast img {
  width: 100px;
  height: 100px;
}
.Podcast .media-text {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 134px;
  width: 60%;
  margin-left: 20px;
}
.Podcast .media-text .songname {
  color: #000;
}
.Podcast .media-text p {
  font-size: 14px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  color: #888;
}
.arrow {
  position: absolute;
  right: 12px;
  top: 47.5px;
  width: 6px;
  height: 6px;
  box-sizing: content-box;
  border-right: 1px solid #b2b2b2;
  border-bottom: 1px solid #b2b2b2;
  transform: rotate(-45deg);
}
.Podcast .media-text .songname[data-v-ea8c908c] {
  margin-left: 10px;
}
</style>
